{include title="添加管理员" keywords="" description=""  file='../application/admin/view/layout/header.html' /}
<body>
<article class="page-container">
	<form class="form form-horizontal" id="form-admin-add" action="{:url('admin/admin_menu/menuEdit')}">
		{:token()}
		<input type="hidden" name="id" value="{$data['id']}">
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">上级菜单：</label>
		<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
		<select class="select" name="pid">
			<option value="0">---顶级菜单---</option>
			{foreach $menu_tree as $k => $v}
				<option
						{if ($data['pid']==$v['id'])}selected {/if}
				value="{$v['id']}">{:str_repeat('　　',$v['level']).'|--'.$v['name']}</option>
			{/foreach}
		</select>
		</span> </div>
	</div>

    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>菜单名称：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" value="{$data['name']}" autocomplete="off" placeholder="菜单名称" name="name">
        </div>
    </div>

	<div class="row cl">
        <label class="form-label col-xs-4 col-sm-3">URL路径：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="{$data['url']}" placeholder="URL路径" name="url">
			<span>如：admin/index/index</span>

		</div>
    </div>

	<div class="row cl menu_logo">
		<label class="form-label col-xs-4 col-sm-3">菜单图标：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" value="{$data['logo']}" autocomplete="off" placeholder="菜单图标" name="logo">
			<span>如：Hui-iconfont-jiandao <a target="_blank" href="http://www.h-ui.net/Hui-3.7-Hui-iconfont.shtml">参考地址</a></span>
		</div>
	</div>

	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">是否显示：</label>
		<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
		<select class="select" name="type">
			<option {if ($data['type']==0)}selected{/if} value="0">否</option>
			<option {if ($data['type']==1)}selected{/if} value="1">是</option>
		</select>
	</span> </div>
	</div>

	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">菜单状态：</label>
		<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
		<select class="select" name="status">
				<option {if ($data['status']==0)}selected{/if} value="1">正常</option>
				<option {if ($data['status']==0)}selected{/if} value="0">禁用</option>
		</select>
		</span> </div>
	</div>

	<div class="row cl">
		<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
			<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
		</div>
	</div>
	</form>
</article>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
$(function(){
	//前端验证
    var check = $(".form").Validform({
        tiptype: function (msg, o) {
            if (o.type == 3) {layer.msg(msg, {icon: 2});}
        },
        ajaxPost: true,
        callback: function (data) {
            if(data.status=='y'){
                layer.msg(data.info, {icon: 1});
                setTimeout(function(){
                    parent.location.reload();
                },1000);
            }else{
                $("[name=__token__]").val(data.token);
            }
        }
    });
    check.addRule([
        {ele: "[name='name']", datatype: '*1-10', nullmsg: '请填写菜单名称', errormsg: "菜单名称1至10位之间"}
    ]);
});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>